const generator = require("@babel/generator").default;
const parse = require('@babel/parser')
const traverse = require('@babel/traverse').default
const types = require('@babel/types')
const fs = require('fs');
const path = require('path');

jscode = fs.readFileSync(path.resolve(__dirname, 'encode.js'), 'utf8');

// JS 转 ast语法树

// 转换js代码为ast树结构
let ast = parse.parse(jscode);
try {
    let key_arry = []

    const get_key = {
        MemberExpression(path) {
            let { object, property } = path.node;
            if (!types.isCallExpression(object) || !types.isCallExpression(property)) {
                return;
            }
            if (!types.isIdentifier(object.callee) || object.arguments.length != 0) {
                return;
            }
            if (!types.isIdentifier(property.callee)) {
                return;
            }

            if (key_arry.includes(path.toString())) {
                return;
            }

            // console.log(path.toString())

            key_arry.push(path.toString())
        }
    }

    traverse(ast, get_key)

    console.log(key_arry)

    // let result_map = {};
    // for (let i = 0; i < key_arry.length; i++) {
    //     try {
    //         let result = eval(key_arry[i] + '()');
    //         console.log(result)
    //         if (typeof result == 'function') continue;
    //         result_map[key_arry[i]] = result;
    //         console.log(`${key_arry[i]} ===> ${result}`)
    //     } catch(e) {
    //     }
    // }
    // console.log(result_map)

    let result_map = {
        "YB()[vU(Ab)]": "-1",
        "wA()[kV(W9)]": "navigator",
        "Fw()[pq(AB)]": "plugins",
        "FA()[Uh(C8)]": "Math",
        "FA()[Uh(M4)]": "stackLen",
        "FA()[Uh(AT)]": "__webdriverFuncgeb",
        "FA()[Uh(nb)]": "random",
        "mV()[DB(Xn)]": "toString",
        "Fw()[pq(C8)]": "1",
        "wA()[kV(zV)]": "createElement",
        "wA()[kV(RQ)]": "0",
        "wA()[kV(C8)]": "6",
        "wA()[kV(Bb)]": "prototype",
        "Fw()[pq(ZB)]": "window",
        "mV()[DB(BQ)]": "chrome",
        "FA()[Uh(kX)]": "PdAxxsx3RRRRRR",
        "FA()[Uh(Ug)]": "name",
        "wA()[kV(TA)]": "Object",
        "mV()[DB(Ag)]": "keys",
        "wA()[kV(PV)]": "join",
        "wA()[kV(Jw)]": "Pd",
        "wA()[kV(GB)]": ",",
        "wA()[kV(hX)]": "",
        "FA()[Uh(Jw)]": "length",
        "FA()[Uh(bT)]": "Array",
        "JM()[IQ(Jw)]": "Symbol",
        "mV()[DB(O4)]": "undefined",
        "JM()[IQ(vA)]": "fromCharCode",
        "JM()[IQ(gQ)]": "",
        "wA()[kV(qA)]": "iterator",
        "mV()[DB(Ob)]": "PushManager",
        "Fw()[pq(hb)]": "e",
        "YB()[vU(z9)]": undefined,
        "YB()[vU(C8)]": "",
        "Fw()[pq(UA)]": "mc",
        "Fw()[pq(NU)]": "Document",
        "FA()[Uh(tq)]": "hasOwnProperty",
        "FA()[Uh(VT)]": "hasPrivateToken",
        "mV()[DB(qw)]": "message",
        "Fw()[pq(Og)]": "includes",
        "Fw()[pq(bq)]": "get",
        "wA()[kV(OX)]": "test",
        "Fw()[pq(Lg)]": "PdR",
        "wA()[kV(qw)]": "3",
        "wA()[kV(Yh)]": "RegExp",
        "Fw()[pq(Ib)]": "Pdnn",
        "Fw()[pq(TA)]": "a",
        "kh()[Fq(jM)]": undefined,
        "Fw()[pq(CQ)]": "bm_sz",
        "Fw()[pq(Ug)]": "s",
        "Fw()[pq(M4)]": "runtimePlaywright",
        "FA()[Uh(O4)]": "document",
        "wA()[kV(BA)]": "city",
        "wA()[kV(kr)]": "addEventListener",
        "Fw()[pq(MA)]": "input",
        "Fw()[pq(KM)]": "biometricAPInflight",
        "mV()[DB(Mr)]": "hardwareConcurrency",
        "FA()[Uh(IX)]": "ln",
        "wA()[kV(gg)]": "configurable",
        "mV()[DB(fA)]": "wdr",
        "Fw()[pq(jM)]": "n",
        "FA()[Uh(NG)]": "Function",
        "kh()[Fq(vA)]": "create",
        "kh()[Fq(hb)]": "stack",
        "mV()[DB(ZB)]": "string",
        "wA()[kV(CQ)]": "split",
        "FA()[Uh(Ob)]": "\n",
        "Fw()[pq(gn)]": "do_en",
        "Fw()[pq(wQ)]": "stripProxyFromErrors",
        "mV()[DB(MA)]": "at newHandler.<computed> [as apply]",
        "wA()[kV(kA)]": "String",
        "Fw()[pq(RQ)]": "charAt",
        "FA()[Uh(gg)]": "charCodeAt",
        "wA()[kV(hb)]": "codePointAt",
        "FA()[Uh(kA)]": "function",
        "FA()[Uh(sX)]": "startTimestamp",
        "wA()[kV(bq)]": "push",
        "FA()[Uh(B2)]": "phone",
        "FA()[Uh(tg)]": "replace",
        "kh()[Fq(RQ)]": "g",
        "FA()[Uh(PQ)]": "fpValStr",
        "mV()[DB(B2)]": "td",
        "Fw()[pq(S8)]": "screen",
        "kh()[Fq(ZB)]": undefined,
        "wA()[kV(lT)]": "secret",
        "mV()[DB(vA)]": "parseInt",
        "mV()[DB(PV)]": "year",
        "FA()[Uh(PV)]": ";",
        "mV()[DB(Ib)]": "decodeURIComponent",
        "FA()[Uh(Rg)]": "fn",
        "mV()[DB(Lg)]": "first",
        "FA()[Uh(lq)]": "isNaN",
        "mV()[DB(pX)]": "RTCPeerConnection",
        "wA()[kV(jM)]": "i",
        "Fw()[pq(tq)]": "enumerable",
        "Fw()[pq(kA)]": "value",
        "FA()[Uh(TA)]": "writable",
        "FA()[Uh(hX)]": "defineProperty",
        "FA()[Uh(qA)]": "key",
        "wA()[kV(wr)]": "symbol",
        "FA()[Uh(pX)]": "slice",
        "FA()[Uh(LX)]": "object",
        "kh()[Fq(qB)]": undefined,
        "FA()[Uh(qw)]": "o",
        "wA()[kV(Qh)]": "Number",
        "wA()[kV(DM)]": "Set",
        "kh()[Fq(hX)]": undefined,
        "kh()[Fq(z9)]": "",
        "wA()[kV(IX)]": "concat",
        "mV()[DB(dM)]": "Pdq",
        "Fw()[pq(KQ)]": "lastAprAutopostTS",
        "mV()[DB(wr)]": "Pdn",
        "wA()[kV(rV)]": "k",
        "wA()[kV(rh)]": "aprApTimer",
        "wA()[kV(bh)]": "__webdriver_script_fn",
        "FA()[Uh(BQ)]": "open",
        "Fw()[pq(W9)]": "__driver_evaluate",
        "Fw()[pq(kX)]": "PdKqcn",
        "wA()[kV(Hh)]": "__selenium_evaluate",
        "wA()[kV(Cr)]": "bmint_",
        "wA()[kV(B2)]": "password",
        "wA()[kV(bT)]": "9",
        "wA()[kV(S8)]": "birthMonth",
        "Fw()[pq(C9)]": "__fxdriver_evaluate",
        "Fw()[pq(DM)]": "getAttribute",
        "wA()[kV(AT)]": "localStorage",
        "FA()[Uh(L9)]": "getItem",
        "mV()[DB(sX)]": "Boolean",
        "Fw()[pq(fA)]": "head",
        "Fw()[pq(bQ)]": "removeItem",
        "wA()[kV(xQ)]": "setItem",
        "FA()[Uh(BA)]": "firstName",
        "Fw()[pq(IX)]": "zip",
        "wA()[kV(NG)]": "location",
        "Fw()[pq(nw)]": "protocol",
        "wA()[kV(Ob)]": "//",
        "Fw()[pq(Y8)]": "hostname",
        "wA()[kV(VT)]": "send",
        "mV()[DB(nw)]": "size",
        "wA()[kV(Y8)]": "aprApInFlight",
        "mV()[DB(NG)]": "setPrototypeOf",
        "wA()[kV(lq)]": "webdriver",
        "wA()[kV(Ug)]": "toStringTag",
        "FA()[Uh(DM)]": "isArray",
        "Fw()[pq(z9)]": "7",
        "FA()[Uh(rq)]": "style",
        "wA()[kV(gn)]": "src",
        "wA()[kV(NU)]": "JSON",
        "wA()[kV(g1)]": "stringify",
        "mV()[DB(Uq)]": "collectHeadlessSignals",
        "mV()[DB(kX)]": "country",
        "FA()[Uh(RQ)]": "K",
        "wA()[kV(O4)]": "8",
        "wA()[kV(s4)]": "reset",
        "FA()[Uh(M7)]": "startTs",
        "FA()[Uh(vA)]": "2",
        "FA()[Uh(Kk)]": "ajt",
        "Fw()[pq(LX)]": "c",
        "wA()[kV(Czj)]": "+",
        "mV()[DB(sV)]": "unk",
        "FA()[Uh(VB)]": "hidden",
        "mV()[DB(C9)]": "geb",
        "mV()[DB(s4)]": "visibilitychange",
        "Fw()[pq(s4)]": "pur",
        "mV()[DB(zn)]": "deviceorientation",
        "mV()[DB(gn)]": "DeviceMotionEvent",
        "mV()[DB(bT)]": "p",
        "Fw()[pq(Mn)]": "nodeType",
        "wA()[kV(HM)]": "getElementsByTagName",
        "FA()[Uh(rV)]": "number",
        "FA()[Uh(Cr)]": "id",
        "Fw()[pq(Uq)]": "processAutopostRes",
        "wA()[kV(lX)]": "toLowerCase",
        "FA()[Uh(sB)]": "startTracking",
        "wA()[kV(KQ)]": "cdc_adoQpoasnfa76pfcZLmcfl_Array",
        "wA()[kV(MM)]": "__webdriver_script_function",
        "wA()[kV(Uf)]": "h",
        "FA()[Uh(JNj)]": "XMLHttpRequest",
        "Fw()[pq(vjj)]": "ActiveXObject",
        "wA()[kV(IW)]": "callPhantom",
        "FA()[Uh(NO)]": "documentMode",
        "Fw()[pq(zr)]": "webstore",
        "wA()[kV(br)]": "onLine",
        "Fw()[pq(TH)]": "opera",
        "FA()[Uh(rw)]": "InstallTrigger",
        "wA()[kV(Kjj)]": "HTMLElement",
        "Fw()[pq(In)]": "Constructor",
        "FA()[Uh(s4)]": "ver",
        "FA()[Uh(zJ)]": "mozInnerScreenY",
        "Fw()[pq(Q0)]": "ran",
        "FA()[Uh(nP)]": "vibrate",
        "Fw()[pq(F8)]": "getBattery",
        "wA()[kV(nh)]": "FileReader",
        "FA()[Uh(v0)]": "cpen:",
        "Fw()[pq(J1)]": "ajr",
        "Fw()[pq(Gf)]": ",dm:",
        "Fw()[pq(HM)]": ",cwen:",
        "Fw()[pq(lX)]": ",non:",
        "FA()[Uh(gv)]": "ash",
        "FA()[Uh(v8)]": ",opc:",
        "FA()[Uh(bdj)]": ",fc:",
        "FA()[Uh(Wdj)]": ",wrc:",
        "Fw()[pq(Px)]": ",isc:",
        "mV()[DB(HM)]": ",vib:",
        "FA()[Uh(Hdj)]": ",bat:",
        "FA()[Uh(Sf)]": ",x11:",
        "mV()[DB(lX)]": ",x12:",
        "wA()[kV(c8)]": "dm_en",
        "wA()[kV(f9)]": "pluginData",
        "wA()[kV(nw)]": "ajTypeBitmask",
        "FA()[Uh(qG)]": "checkIprSignals",
        "wA()[kV(Zs)]": "POST",
        "wA()[kV(nZj)]": "onloadend",
        "wA()[kV(NNj)]": "{\"sensor_data\":",
        "wA()[kV(ZW)]": "}",
        "mV()[DB(KM)]": "failedAprApBackoff",
        "Fw()[pq(sB)]": "<bpd>",
        "FA()[Uh(dM)]": "fmget_targets",
        "FA()[Uh(AM)]": "DeviceOrientationEvent",
        "Fw()[pq(xI)]": "jsrf",
        "mV()[DB(GX)]": "TouchEvent",
        "Fw()[pq(FQ)]": "t_en",
        "mV()[DB(FQ)]": "URL",
        "FA()[Uh(Hh)]": "awesomium",
        "Fw()[pq(XB)]": "\\\\|\"",
        "wA()[kV(gH)]": "fpValCalculated",
        "FA()[Uh(bq)]": "assign",
        "FA()[Uh(g1)]": "PiZtE",
        "wA()[kV(rb)]": "firstLoad",
        "FA()[Uh(c8)]": "pev",
        "FA()[Uh(UA)]": "deviceData",
        "wA()[kV(Mn)]": "totVel",
        "mV()[DB(XB)]": "deltaTimestamp",
        "mV()[DB(TA)]": "email",
        "mV()[DB(MI)]": "kevl",
        "Fw()[pq(MI)]": "mevl",
        "Fw()[pq(qG)]": "tevl",
        "Fw()[pq(QX)]": "devl",
        "FA()[Uh(kr)]": "dmvl",
        "wA()[kV(dI)]": "pevl",
        "FA()[Uh(xI)]": "tovl",
        "FA()[Uh(J1)]": "delt",
        "Fw()[pq(M7)]": "it",
        "mV()[DB(qG)]": "sts",
        "Fw()[pq(AM)]": "fct",
        "Fw()[pq(g1)]": "dd2",
        "FA()[Uh(pT)]": "kc",
        "wA()[kV(vG)]": "ww8",
        "mV()[DB(QX)]": "pc",
        "wA()[kV(Vf)]": "tc",
        "wA()[kV(VB)]": "tst",
        "mV()[DB(M7)]": "rval",
        "mV()[DB(sB)]": "rVal",
        "Fw()[pq(kr)]": "rcfp",
        "mV()[DB(AM)]": "nfas",
        "wA()[kV(z9)]": ".",
        "wA()[kV(p0)]": "signals",
        "wA()[kV(FU)]": "hea",
        "mV()[DB(g1)]": "dvc",
        "wA()[kV(lV)]": "srd",
        "wA()[kV(Flj)]": "navPerm",
        "wA()[kV(Rg)]": "ax",
        "mV()[DB(LFj)]": "getElementById",
        "wA()[kV(E4)]": "publish",
        "FA()[Uh(Flj)]": "fpt",
        "FA()[Uh(f9)]": "din",
        "FA()[Uh(rRj)]": "eem",
        "FA()[Uh(V2)]": "ffs",
        "Fw()[pq(pT)]": "inf",
        "FA()[Uh(zn)]": "kev",
        "mV()[DB(xI)]": "dme",
        "FA()[Uh(LFj)]": "mev",
        "Fw()[pq(sV)]": "doe",
        "mV()[DB(J1)]": "tev",
        "FA()[Uh(gH)]": "sde",
        "Fw()[pq(Flj)]": "pmo",
        "Fw()[pq(f9)]": "dpw",
        "FA()[Uh(rb)]": "pac",
        "wA()[kV(C7)]": "per",
        "wA()[kV(gEj)]": "dsi",
        "FA()[Uh(Mn)]": "wsl",
        "FA()[Uh(dI)]": "oev",
        "Fw()[pq(rRj)]": "if",
        "wA()[kV(S3)]": "jse",
        "wA()[kV(KJ)]": "Error extracting obfuscation keys.",
        "wA()[kV(V2)]": "buildPostData",
        "Fw()[pq(Kk)]": "</bpd>",
        "Fw()[pq(hX)]": "l",
        "wA()[kV(rRj)]": "iframeChromium",
        "FA()[Uh(Vf)]": "_sdTrace",
        "FA()[Uh(XB)]": "calculateFP",
        "mV()[DB(s8)]": "mozConnection",
        "mV()[DB(z9)]": "d",
        "Fw()[pq(gH)]": "touchmove",
        "mV()[DB(c8)]": "touchstart",
        "wA()[kV(zr)]": "touchend",
        "FA()[Uh(KM)]": "__webdriver_script_func",
        "mV()[DB(gH)]": "touchcancel",
        "Fw()[pq(rb)]": "mousedown",
        "mV()[DB(rb)]": "pointerdown",
        "wA()[kV(TH)]": "pointerup",
        "FA()[Uh(Q9)]": "keydown",
        "wA()[kV(In)]": "keyup",
        "mV()[DB(Mn)]": "keypress",
        "FA()[Uh(Q0)]": "permissions",
        "FA()[Uh(zk)]": "synthesisSpeechHash",
        "Fw()[pq(dI)]": "speechSynthesis",
        "mV()[DB(VB)]": "getVoices",
        "Fw()[pq(O4)]": "5",
        "Fw()[pq(vG)]": "onvoiceschanged",
        "FA()[Uh(cJ)]": "speaker",
        "Fw()[pq(p0)]": "bluetooth",
        "mV()[DB(p0)]": "ambient-light-sensor",
        "mV()[DB(FU)]": "accelerometer",
        "wA()[kV(qv)]": "gyroscope",
        "wA()[kV(w3)]": "magnetometer",
        "wA()[kV(Aq)]": "clipboard",
        "mV()[DB(lV)]": "accessibility-events",
        "Fw()[pq(FU)]": "query",
        "wA()[kV(q4)]": "then",
        "mV()[DB(Q9)]": "catch",
        "mV()[DB(pT)]": "map",
        "FA()[Uh(In)]": "all",
        "wA()[kV(Kk)]": "navigatorPermissions",
        "Fw()[pq(Xn)]": "__fxdriver_unwrapped",
        "wA()[kV(nP)]": "ceil",
        "Fw()[pq(KJ)]": "Pdq3Ns",
        "FA()[Uh(w3)]": "height",
        "wA()[kV(v0)]": "maxTouchPoints",
        "FA()[Uh(Px)]": "availWidth",
        "FA()[Uh(FQ)]": "getHeadlessBrowserData",
        "FA()[Uh(TY)]": "availHeight",
        "FA()[Uh(qv)]": "width",
        "wA()[kV(zJ)]": "documentElement",
        "mV()[DB(vjj)]": "innerWidth",
        "Fw()[pq(Czj)]": "outerWidth",
        "Fw()[pq(xCj)]": "ua",
        "mV()[DB(zr)]": "xag",
        "wA()[kV(v8)]": "nal",
        "mV()[DB(TH)]": "npl",
        "mV()[DB(In)]": "pha",
        "Fw()[pq(b7)]": "asw",
        "Fw()[pq(cJ)]": "swi",
        "wA()[kV(M9)]": "spynner_additional_js_loaded",
        "wA()[kV(bdj)]": "wiw",
        "wA()[kV(Wdj)]": "wow",
        "wA()[kV(Hdj)]": "ucs",
        "mV()[DB(F8)]": "hal",
        "wA()[kV(Sf)]": "ibr",
        "FA()[Uh(lO)]": "fmh",
        "Fw()[pq(TY)]": "fmz",
        "FA()[Uh(MG)]": "ssh",
        "mV()[DB(zV)]": "perfAttr",
        "FA()[Uh(OX)]": "failedAprApCnt",
        "Fw()[pq(FX)]": "getTelemetryHeaderForInline",
        "Fw()[pq(Rg)]": "address",
        "mV()[DB(C8)]": "r",
        "mV()[DB(tq)]": "_abck",
        "mV()[DB(bq)]": "CustomErrorAfterFunctionCall",
        "mV()[DB(kA)]": "ak_",
        "mV()[DB(jM)]": "text",
        "Fw()[pq(PV)]": "tel",
        "mV()[DB(Ug)]": "user",
        "wA()[kV(c4)]": "pass",
        "Fw()[pq(rV)]": "pw",
        "FA()[Uh(Qh)]": "last",
        "mV()[DB(gg)]": "sur",
        "mV()[DB(hb)]": "mobile",
        "mV()[DB(CQ)]": "pn",
        "Fw()[pq(Cr)]": "street",
        "Fw()[pq(Qh)]": "ctry",
        "FA()[Uh(c4)]": "pin",
        "FA()[Uh(lT)]": "username",
        "Fw()[pq(B2)]": "lastName",
        "wA()[kV(tg)]": "zipcode",
        "wA()[kV(IU)]": "birthYear",
        "Fw()[pq(c4)]": "birthDay",
        "mV()[DB(Br)]": "subscribe",
        "FA()[Uh(ZB)]": "AAAAAHpslhQAALcAFAABIrcAFAAAtwAUAAFctwBTAAZ3aW5kb3cUAAluYXZpZ2F0b3IVARQACXVzZXJBZ2VudBUBFAAFc3BsaXQVAJoBAAEUAARqb2luFQCaAQABFAAFc3BsaXQVAJoBAAEUAARqb2luFQCaAQABKPdMAAAAAAAFFAACV1qbAAAAAACybJYUAAJwRJsAtwK3AFMAAnBEFAAIdG9TdHJpbmcVAJoBAAEo90wAAQAAAI0UAAJOTpsAAAAAAU5slhQAAkRtmwDKFAACa0abAD4AABUFUwACa0abALcAFAACbmqbAFMAAkRtFAAGbGVuZ3RoFQFTAAJuap52AAAAAURsUwACbmq3AFMAAkRtFAAKY2hhckNvZGVBdBUAmgEAAbchUwACa0YCgVMAAmtGmwAoUwACbmp9AgAAAADrtwBTAAJrRkco90wAAQAAAMUUAAJJUpsAAAAACZ9slhQAAldtmwAUAAJLRpsAFAACUlqbABQAAkJsmwDKFAACbXCbABQAAW5TAAJtcJsAAAAACYdsyhQAAmxjmwDKFAACS1qbAMoUAAJwTpsAyhQ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AFMABE1hdGgUAANhYnMVAJoBAAEVAVMAAk81a1MAAk81mwAoUwACZEZ9AgAAAAaTFAAAUwACczabAFMAAldtUwAGd2luZG93FAAEYm1haxUBFAAHc3RhcnRUcxUBa7cAUwAGU3RyaW5nmgEAAVMAAlJatwBTAAZTdHJpbmeaAQABa1MAAlJLmwC3ABQAAkw2mwBTAAJSSxQABmxlbmd0aBUBUwACTDaedgAAAAk7bMoUAAFVmwBTAAJKRhQABmxlbmd0aBUBUwACTDa3AFMAAlJLFAAGY2hhckF0FQCaAQABtwC3CrcAUwAIcGFyc2VJbnSaAQACf1MAAVWbAFMAAkpGUwABVRUBUwACczZrUwACczabAChTAAJMNn0CAAAACKtTAAJPNVMAAnM2a1MAAm1wmwAoAAAACW9TAAZ3aW5kb3cUAAluYXZpZ2F0b3KYHQAAAAOfKPdsFAACY0ubABQAAWVTAAJtcJsAKPf3PgAACYY+AAAJcT4AAAGX6ABTAAJtcCj3TAAEAAABYRQAAnNamwDf",
        "Fw()[pq(Ob)]": "filePath",
        "Fw()[pq(VT)]": "devPixelRatio",
        "Fw()[pq(kb)]": "sensorData",
        "mV()[DB(dU)]": "fpcf",
        "FA()[Uh(gn)]": "setBraveSignal",
        "Fw()[pq(zV)]": "collectSeleniumData",
        "FA()[Uh(GX)]": "getDeviceData",
        "Fw()[pq(dU)]": "getBrowser",
        "wA()[kV(zn)]": "checkStopProtocol",
        "FA()[Uh(MI)]": "postData",
        "wA()[kV(LFj)]": "checkBiometricSignal",
        "FA()[Uh(QX)]": "extractAbckHeartbeatTimestamp",
        "mV()[DB(zk)]": "https:",
        "Fw()[pq(Bb)]": "m",
        "Fw()[pq(bT)]": "AAAAA6xslhQAAnZtmwAUAAJxS5sAyhQAAnhLmwDKFAACbUSbALcHtwC3DbcAtwy3ALcTtwC3C7cAtxS3ALcPtwC3DrcAtxW3ALcAtwC3ArcAtwq3ALcStwC3CLcAtwG3ALcEtwC3EbcAtwm3ALcFtwC3A7cAtwa3ALcWtwC3ELc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AJ2bSgo9ygo90wAAgAAAAUUAAJTNZsA3w==",
        "mV()[DB(Aq)]": "b",
        "FA()[Uh(Kjj)]": "get_telemetry",
        "mV()[DB(q4)]": "form_submit",
        "mV()[DB(Gf)]": "spawn",
        "wA()[kV(gv)]": "mozAlarms",
        "FA()[Uh(Zs)]": "listFunctions",
        "FA()[Uh(nZj)]": "^http:\\/\\/",
        "wA()[kV(tqj)]": "/_bm/_data",
        "FA()[Uh(NNj)]": "lastIndexOf",
        "Fw()[pq(q4)]": "_setPowState",
        "Fw()[pq(gv)]": "applyFunc",
        "Fw()[pq(NO)]": "f",
        "Fw()[pq(rw)]": "cTc",
        "FA()[Uh(ZW)]": "j",
        "mV()[DB(NO)]": "debug",
        "Fw()[pq(Kh)]": "watinExpressionError",
        "wA()[kV(rw)]": "PdnV",
        "wA()[kV(Pqj)]": "currentScript",
        "mV()[DB(rw)]": "nodeName",
        "mV()[DB(RQ)]": "__esModule",
        "Fw()[pq(qw)]": "exports",
        "FA()[Uh(Bb)]": "Module",
        "mV()[DB(xCj)]": "$cdc_asdjflasutopfhvcZLmcfl_",
        "mV()[DB(cJ)]": "driver",
        "mV()[DB(b7)]": "XPathResult",
        "wA()[kV(lO)]": "product",
        "FA()[Uh(CQ)]": ":",
        "wA()[kV(kX)]": "PdAxNcs",
        "Fw()[pq(gg)]": "PdVncVcANncx3RRRRRR",
        "Fw()[pq(gw)]": "cdc_adoQpoasnfa76pfcZLmcfl_Promise",
        "FA()[Uh(Kh)]": "cdc_adoQpoasnfa76pfcZLmcfl_Symbol",
        "wA()[kV(KM)]": "OSMJIF",
        "mV()[DB(PQ)]": "_Selenium_IDE_Recorder",
        "FA()[Uh(Br)]": "__$webdriverAsyncExecutor",
        "mV()[DB(AB)]": "__driver_unwrapped",
        "mV()[DB(EV)]": "__lastWatirConfirm",
        "mV()[DB(Zr)]": "__lastWatirPrompt",
        "FA()[Uh(GB)]": "__selenium_unwrapped",
        "FA()[Uh(KQ)]": "__webdriver_evaluate",
        "wA()[kV(dM)]": "__webdriver_unwrapped",
        "FA()[Uh(bh)]": "callSelenium",
        "mV()[DB(gw)]": "calledPhantom",
        "FA()[Uh(MM)]": "domAutomationController",
        "mV()[DB(W9)]": "watinExpressionResult",
        "Fw()[pq(Br)]": "$chrome_asyncScriptInfo",
        "Fw()[pq(rh)]": "dummy",
        "wA()[kV(vA)]": "parseFloat",
        "wA()[kV(ZB)]": "4",
        "mV()[DB(C7)]": "credentials",
        "Fw()[pq(C7)]": "appMinorVersion",
        "mV()[DB(gEj)]": "getGamepads",
        "mV()[DB(S3)]": "getStorageUpdates",
        "FA()[Uh(F8)]": "mediaDevices",
        "wA()[kV(JNj)]": "mozIsLocallyAvailable",
        "Fw()[pq(gEj)]": "mozPhoneNumberService",
        "Fw()[pq(S3)]": "registerProtocolHandler",
        "FA()[Uh(lX)]": "hypot",
        "FA()[Uh(Gf)]": "requestMediaKeySystemAccess",
        "wA()[kV(NO)]": "requestWakeLock",
        "Fw()[pq(s8)]": "sendBeacon",
        "mV()[DB(KJ)]": "serviceWorker",
        "mV()[DB(Czj)]": "storeWebWideTrackingException",
        "FA()[Uh(HM)]": "webkitGetGamepads",
        "wA()[kV(MG)]": "emit",
        "mV()[DB(w3)]": "aeiouy13579",
      }


    const tihuan = {
        CallExpression(path) {
            let callee = path.node.callee;
            if (!types.isMemberExpression(callee)) {
                return;
            }
            let { object, property } = callee;

            if (types.isMemberExpression(object) && types.isIdentifier(property)
                && ['call', 'apply'].includes(property.name)) {
                if (!Object.keys(result_map).includes(generator(object).code)) {
                    return;
                }
                path.replaceWith(types.valueToNode(result_map[generator(object).code]))
                console.log(generator(object).code, '--------->', result_map[generator(object).code])
            }

            if (types.isCallExpression(object) && types.isCallExpression(property)) {
                if (types.isIdentifier(object.callee) && object.arguments.length == 0) {
                    if (types.isIdentifier(property.callee)) {

                        if (!Object.keys(result_map).includes(generator(callee).code)) {
                            return;
                        }
                        path.replaceWith(types.valueToNode(result_map[generator(callee).code]))
                        console.log(generator(callee).code, '--------->', result_map[generator(callee).code])
                    }
                }
            }

        }
    }
    traverse(ast, tihuan)

} catch (e) {
    console.log(e);
} finally {
    //TODO Finally ast还原js
    code = generator(ast, opts = { jsescOption: { "minimal": true } }).code// 处理中文Unicode
    //文件保存
    fs.writeFile(path.resolve(__dirname, 'decode.js'), code, (err) => {
    });

}
